package com.renwei.yunlong.utils;


import com.renwei.yunlong.bean.contacts.Contact;

import java.util.Comparator;

/**
 * @author
 */
public class ContactPinyinComparator implements Comparator<Contact> {

    @Override
    public int compare(Contact o1, Contact o2) {
        if ("@".equals(o1.getLetter())
                || "#".equals(o2.getLetter())) {
            return -1;
        } else if ("#".equals(o1.getLetter())
                || "@".equals(o2.getLetter())) {
            return 1;
        } else {
            return o1.getLetter().compareTo(o2.getLetter());
        }
    }
}
